<template>
	<view class="page-total">
		<!-- 分类列表 -->
		<!-- <view class="classify-list">
			<view class="list" @click="onSkip('classify')">
				<view class="thumb"><image src="/static/img/pin_01.png"></image></view>
				<view class="name"><text class="one-omit">小米</text></view>
			</view>
			<view class="list" @click="onSkip('classify')">
				<view class="thumb"><image src="/static/img/pin_02.png"></image></view>
				<view class="name"><text class="one-omit">华为</text></view>
			</view>
			<view class="list" @click="onSkip('classify')">
				<view class="thumb"><image src="/static/img/pin_03.png"></image></view>
				<view class="name"><text class="one-omit">荣耀</text></view>
			</view>
			<view class="list" @click="onSkip('classify')">
				<view class="thumb"><image src="/static/img/pin_04.png"></image></view>
				<view class="name"><text class="one-omit">iPhone</text></view>
			</view>
			<view class="list" @click="onSkip('classify')">
				<view class="thumb"><image src="/static/img/pin_05.png"></image></view>
				<view class="name"><text class="one-omit">vivo</text></view>
			</view>
		</view> -->
		<!-- 超值爆款 -->
		<!-- <view class="super-hot-style">
			<view class="hot-title">
				<view class="iconfont icon-zhizi"></view>
				<view class="title">超值爆款</view>
			</view>
			<view class="goods-list">
				<view class="list" v-for="(item, index) in classGoodsList" @click="onSkip('goods')" :key="index">
					<view class="thumb">
						<image :src="item.img" mode="widthFix"></image>
					</view>
					<view class="title"><text class="one-omit">{{item.name}}</text></view>
					<view class="price">
						<view class="retail-price">
							<text class="min">￥</text>
							<text class="max">{{item.price}}</text>
						</view>
						<view class="sales-volume">已售4件</view>
					</view>
				</view>
			</view>
		</view> -->
		<!-- 更多热卖 -->
		<view class="more-hot">
			<!-- <view class="hot-title">
				<view class="title">
					<text class="iconfont icon-xiedian"></text>
					<text class="icon">更多热卖</text>
					<text class="iconfont icon-xiedian"></text>
				</view>
			</view> -->
      <view class="goods-list">
        <view class="list" v-for="(item,index) in goodsList" @click="onSkip('goods',item)" :key="index">
          <view class="pictrue">
            <image class="image" :src="item.goods_thumbnail_url" mode="heightFix"></image>
          </view>
          <view class="title-tag">
            <view class="tag">
              <text class="text" v-if="item.is_goods === 1">特价</text>
              {{item.goods_name}}
            </view>
          </view>
          <view class="price-info">
            <view class="user-price">
              <text class="text min">券后￥</text>
              <text class="text max">{{(item.min_group_price - item.coupon_discount) / 100}}</text>
            </view>
            <view class="vip-price">
              <image  class="image" src="/static/vip_ico.png"></image>
              <text class="text">优惠券￥{{item.coupon_discount / 100}}</text>
            </view>
          </view>
        </view>
      </view>
		</view>
	</view>
</template>

<script>
export default {
	props:{
		goodsList:{
			type:Array,
			default() {
				return []
			}
		}
	},
	data() {
		return {
				
		};
	},
	methods:{
		/**
		 * 跳转点击
		 * @param {String} type 跳转类型
		 */
		onSkip(type,item){
			switch (type){
				case 'classify':
					uni.navigateTo({
						url: '/pages/SearchGoodsList/SearchGoodsList',
					})
					break;
				case 'goods':
				let url = `/pages/GoodsDetails/GoodsDetails?goods_sign=${item.goods_sign}&goods_id=${item.goods_id}&search_id=${item.search_id}`
					uni.navigateTo({
						url: url,
						animationType: 'zoom-fade-out',
						animationDuration: 200
					})
					break;
			}
		}
	}
};
</script>

<style lang="scss">
@import './ClassifyData.scss'
</style>
